package collection.stream;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class Test {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        Random r = new Random();
        for (int i = 0; i < 5; i++) {
            list.add(r.nextInt(100));
        }
        System.out.println(list);
        boolean allMatch = list.stream().allMatch(e->e>=60);
        System.out.println("是否全部及格："+allMatch);
        int sum = list.stream().reduce((e1,e2)->e1+e2).get();
        System.out.println(sum);

    }
}
